﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using University.Workshop.Business;

namespace University.Workshop.Presenters.FeesAndFines.Register
{
    public class PresenterRegisterFees
    {
        IRegisterFeesView view;
        Model.FeesAndFines feesAndFines = new Model.FeesAndFines();

        public PresenterRegisterFees(IRegisterFeesView view)
        {
            this.view = view;
        }

        public void RegisterFees()
        {
            try
            {
                feesAndFines.Charge = view.Charge;
                feesAndFines.NewConection = view.NewConnection;
                feesAndFines.Reconnection = view.Reconnection;
                feesAndFines.BaseRate = view.BaseRate;
                feesAndFines.NewMember = view.NewMember;
                feesAndFines.MonthlyContribution = view.MonthlyContribution;
                feesAndFines.NonPayment = view.NonPayment;
                feesAndFines.MeterViolation = view.MeterViolation;
                feesAndFines.EffectiveDate = view.EffectiveDate;

                ManagerFeesAndFines.VerifyDataFees(feesAndFines);
                ManagerFeesAndFines.RegisterFees(feesAndFines);
                view.RestartRegister();
                view.SystemMessage("Las Tarifas Fueron Registradas Exitosamente.!!!!");
            }
            catch (Exception ex)
            {
                view.ErrorMessage(ex.Message);
            }


        }
    }
}
